package com.yf1706.bean;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the social_security_sob database table.
 * 
 */
@Entity
@Table(name="social_security_sob")
@NamedQuery(name="SocialSecuritySob.findAll", query="SELECT s FROM SocialSecuritySob s")
public class SocialSecuritySob implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="social_security_sob_id")
	private int socialSecuritySobId;

	@Temporal(TemporalType.DATE)
	@Column(name="build_date")
	@JSONField(format="yyyy-MM-dd")
	private Date buildDate;

	private String builder;

	@Column(name="emp_num")
	private int empNum;

	private String remark;

	@Column(name="social_security_sob_name")
	private String socialSecuritySobName;

	//bi-directional many-to-one association to SocialSecurity
	@OneToMany(mappedBy="socialSecuritySob")
	@JSONField(serialize = false)
	private List<SocialSecurity> socialSecurities;

	public SocialSecuritySob() {
	}

	public SocialSecuritySob(int socialSecuritySobId, Date buildDate, String builder, int empNum, String remark,
			String socialSecuritySobName) {
		super();
		this.socialSecuritySobId = socialSecuritySobId;
		this.buildDate = buildDate;
		this.builder = builder;
		this.empNum = empNum;
		this.remark = remark;
		this.socialSecuritySobName = socialSecuritySobName;
	}

	@Override
	public String toString() {
		return "SocialSecuritySob [socialSecuritySobId=" + socialSecuritySobId + ", buildDate=" + buildDate
				+ ", builder=" + builder + ", empNum=" + empNum + ", remark=" + remark + ", socialSecuritySobName="
				+ socialSecuritySobName + ", socialSecurities=" + socialSecurities + "]";
	}

	public int getSocialSecuritySobId() {
		return this.socialSecuritySobId;
	}

	public void setSocialSecuritySobId(int socialSecuritySobId) {
		this.socialSecuritySobId = socialSecuritySobId;
	}

	public Date getBuildDate() {
		return this.buildDate;
	}

	public void setBuildDate(Date buildDate) {
		this.buildDate = buildDate;
	}

	public String getBuilder() {
		return this.builder;
	}

	public void setBuilder(String builder) {
		this.builder = builder;
	}

	public int getEmpNum() {
		return this.empNum;
	}

	public void setEmpNum(int empNum) {
		this.empNum = empNum;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSocialSecuritySobName() {
		return this.socialSecuritySobName;
	}

	public void setSocialSecuritySobName(String socialSecuritySobName) {
		this.socialSecuritySobName = socialSecuritySobName;
	}

	public List<SocialSecurity> getSocialSecurities() {
		return this.socialSecurities;
	}

	public void setSocialSecurities(List<SocialSecurity> socialSecurities) {
		this.socialSecurities = socialSecurities;
	}

	public SocialSecurity addSocialSecurity(SocialSecurity socialSecurity) {
		getSocialSecurities().add(socialSecurity);
		socialSecurity.setSocialSecuritySob(this);

		return socialSecurity;
	}

	public SocialSecurity removeSocialSecurity(SocialSecurity socialSecurity) {
		getSocialSecurities().remove(socialSecurity);
		socialSecurity.setSocialSecuritySob(null);

		return socialSecurity;
	}

}